package com.AJava1710D.bingfabao.cyc;

import java.util.concurrent.CyclicBarrier;

/**
 * 作者: LCG
 * 日期: 2020/6/23 11:42
 * 描述:
 */
public class TestCyccli {

    public static void main(String[] args) {

        CyclicBarrier cyclicBarrier=new CyclicBarrier(4);

        TestRun2 testRun1=new TestRun2(cyclicBarrier,3000);
        TestRun2 testRun2=new TestRun2(cyclicBarrier,2000);
        TestRun2 testRun3=new TestRun2(cyclicBarrier,5000);
        TestRun2 testRun4=new TestRun2(cyclicBarrier,4000);

        Thread thread1=new Thread(testRun1,"A运动员");
        Thread thread2=new Thread(testRun2,"B运动员");
        Thread thread3=new Thread(testRun3,"C运动员");
        Thread thread4=new Thread(testRun4,"D运动员");

        thread1.start();
        thread2.start();
        thread3.start();
        thread4.start();

        cyclicBarrier.reset();



    }

}
